<h1>Danh sách nhóm</h1>
    <?php $data = $this->paginator;
    function loadgroupnamebyid($id){
          if($id ==0) return 'Không có';
          else{
          Zend_loader::loadClass('Admin_Models_NoteModel');
          $db = new Admin_Models_NoteModel();
          $result =  $db->loadgroupnamebyid($id);
          
          return $result[0]['name_group'];
          }
    }
    function loadactive($id){
        if($id == 1) return 'Active';
        else return 'Inactive';
    }
?>
<table style="text-align: center" class="table table-hover table-bordered">
    <tr>
        <th style="width:20px">STT</th>
        <th>Name</th>
        <th>Số bài viết</th>
        <th>Số fan</th>
        <th>Thuộc nhóm</th>
        <th>Trạng thái</th>
        <th style="width:60px">Thay đổi</th>
        <th style="width:20px">Xóa</th>
        
    </tr>
    <?php $i=1; foreach($data as $item){ ?>
    <tr>
        <td style="width:20px"><?php echo $i;?></td>
        <td><?php echo $item['name_group'];?></td>
        <td><?php echo $item['count_note'];?></td>   
        <td><?php echo $item['count_fan'];?></td> 
        <td><?php echo loadgroupnamebyid($item['parent'])?></td>
        <td><?php echo loadactive($item['active']); ?></td>
        <td style="text-align: center"><a href="/admin/note/edit-group/?id=<?php echo $item['GroupNoteID'];?>"><i class="icon-pencil"></i></a></td>
        <td><a href="/admin/note/del-note-group/?id=<?php echo $item['GroupNoteID'];?>"><i  onclick="return confirm('Are you sure?')" class="icon-trash"></i></a></td>
       	
    </tr>
    <?php $i++;} ?>
</table>
<?php  echo  $this->paginationControl($this->paginator, 'Sliding', 'note/pagination.phtml',''); ?>
